from django.urls import path
from .api_v1 import *

urlpatterns = [
    path('category/', CategoryList_by_page.as_view(), name='category_list'),
    path('category/<int:pk>/', CategoryDetail.as_view(), name='category_detail'),
    path('category/tree/', get_category_as_tree, name='category_tree'),
    path(r'material/category/tree', material_category_tree, name='material_category_tree'),

    path('template/', TemplateList_by_page.as_view(), name='template_list_by_page'),
    path('template/all/', TemplateList_all.as_view(), name='template_list_all'),
    path('template/<int:pk>/', TemplateDetail.as_view(), name='template_detail'),
    path('template/my/', TemplateList_by_user.as_view(), name='my_template'),
    path(r'file/template/<int:tid>/export', template_file, name='template_file'),
    path('template/my/asc/', TemplateList_by_user_asc.as_view(), name='my_template_asc'),
    path('template/my/des/', TemplateList_by_user_des.as_view(), name='my_template_des'),

    path('tag/', MaterialTagList.as_view(), name='tags_list'),
    path('tag/<int:pk>/', MaterialTagDetail.as_view(), name='tags_detail'),

    path('metadata/', DataMetaList.as_view(), name='metadata_list'),
    path('metadata/my/', DataMeta_by_user.as_view(), name='my_metadata'),
    path('metadata/my/asc/', DataMeta_by_user_asc.as_view(), name='my_metadata_asc'),
    path('metadata/my/des/', DataMeta_by_user_des.as_view(), name='my_metadata_des'),
    path('metadata/<int:pk>/', DataMetaDetail.as_view(), name='metadata_detail'),
    path('metadata/add/', DataMeta_add, name='metadata_add'),
    path('metadata/add/auto/', DataMeta_add_auto, name='metadata_add_auto'),
    path('metadata/add/auto2/', DataMeta_add_auto2, name='metadata_add_auto2'),
    path('metadata/download/', DataMeta_download, name='metadata_download'),

    path('dataset/', DataSetList.as_view(), name='dataset_list'),
    path('dataset/my/', DataSet_by_user.as_view(), name='my_dataset'),
    path('dataset/my/asc/', DataSet_by_user_asc.as_view(), name='my_dataset_asc'),
    path('dataset/my/des/', DataSet_by_user_des.as_view(), name='my_dataset_des'),
    path('dataset/<int:pk>/', DataSetDetail.as_view(), name='dataset_detail'),
    path('dataset/download/<int:pk>/', dataset_download, name='dataset_download'),

    path(r'metadata/file/data/content', uploaded_data_content_file, name='data_content_file'),
    path(r'metadata/file/upload/', uploaded_file, name='uploaded_file'),

    path(r'record/', save_record, name='record'),
    path(r'recommend/', Recommend.as_view(), name='recommend'),

    # yp为了文件上传数据尝试新加的url
    # path(r'metadata/file/upload', uploaded_file, name='uploaded_file'),
]
